package com.ranjiaqi.output;

import java.io.*;

/**
 * @ClassName homework3
 * @Description TODO
 * @Author hp
 * @Date 2021/7/1 13:44
 * @Version 1.0
 **/
public class homework3 {
    public static void main(String[] args) throws IOException {
        write();
    }
    public static void write()throws IOException{
        BufferedWriter bfw=new BufferedWriter(new FileWriter("e://haha.txt"));
        bfw.write("你");
        bfw.newLine();
        bfw.flush();
        bfw.write("我");
        bfw.newLine();
        bfw.flush();
        bfw.write("大家");
        bfw.newLine();
        bfw.flush();
        bfw.close();
        BufferedReader bfr=new BufferedReader(new FileReader("e://haha.txt"));
        BufferedWriter bfw1 = new BufferedWriter(new FileWriter("e://haha1.txt"));
        String line=null;
        while ((line=bfr.readLine())!=null){
            bfw1.write(line+"好\r\n");
            bfw1.flush();
            System.out.println(line);
        }bfw1.append("完毕");
        bfr.close();
        bfw1.close();
    }
}